import request from '@/utils/request'

export function getPersonnel(type) {
  return request({
    url: '/personnel/getPersonnel',
    method: 'get',
    params: { type }
  })
}

export function getPersonnelByPage(type,currentPage,pageSize) {
  return request({
    url: '/personnel/getPersonnelByPage',
    method: 'get',
    params: { type,currentPage,pageSize }
  })
}

export function addPersonnel(data) {
  return request({
    url: `/personnel/addPersonnel`,
    method: 'post',
    data
  })
}

export function updatePersonnel(data) {
  return request({
    url: `/personnel/updatePersonnel`,
    method: 'post',
    data
  })
}

export function deletePersonnel(data) {
  return request({
    url: `/personnel/deletePersonnel`,
    method: 'post',
    data
  })
}

export function getRoles(key){
  return request({
    url: `/data/getData`,
    method: 'get',
    params:{key}
  })
}
